<template>
  <router-view v-slot="{ Component }">
    <keep-alive :include="includeList">
      <component :is="Component" />
    </keep-alive>
  </router-view>
</template>

<script>
import { ref, defineComponent } from "vue"
import { useCounterStore } from '@/pinia/user.js'
 import { storeToRefs } from "pinia";

export default defineComponent(
  {
    name: 'App',
    setup() {
      const CounterStore = useCounterStore()
      const { includeList } = storeToRefs(CounterStore);
      // const includeList = computed(() => {
      //   console.log(CounterStore.includeList)
      //   return CounterStore.includeList
      // })
      // 需要缓存的组件name值
      // const includeList = ref(['fillin'])
      return {
        includeList
      }

      // const router = useRouter()

      // const CounterStore = useCounterStore()
      // // watch(() => router.currentRoute.value.path, () => {
      // //   console.log(`--------------------------`)
      // // }, { immediate: true })

      // if (route.path !== '/') {
      //   if (!CounterStore.token) router.push('/')
      // }
    }
  }
)



</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  
}

/* :root {
  --van-stepper-button-round-theme-color:'#000'
} */
</style>
